import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/page1'
  },
  {
    path: '/page1',
    name: 'page1',
    meta: '示例页面一',
    component: () =>
      import(/* webpackChunkName: 'city' */ '@/views/pages/index')
  },
  {
    path: '/page2',
    name: 'page2',
    meta: '示例页面2',
    component: () =>
      import(/* webpackChunkName: 'city' */ '@/views/pages/index')
  },
  {
    path: '/page3',
    name: 'page3',
    meta: '示例页面3',
    component: () =>
      import(/* webpackChunkName: 'city' */ '@/views/pages/index')
  },
  {
    path: '/element',
    component: () =>
      import(/* webpackChunkName: 'layout' */ '@/views/componentViews/index'),
    children: [
      {
        path: '/element',
        redirect: '/element/index'
      },
      {
        path: '/element/index',
        name: 'elementIndex',
        component: () =>
          import(/* webpackChunkName: 'componentsView' */ '@/views/componentViews/element/index')
      },
      {
        path: '/element/border',
        name: 'elementBorder',
        component: () =>
          import(/* webpackChunkName: 'componentsView' */ '@/views/componentViews/element/border')
      },
      {
        path: '/element/decoration',
        name: 'elementDecoration',
        component: () =>
          import(/* webpackChunkName: 'componentsView' */ '@/views/componentViews/element/decoration')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
